package com.ebao.po.qa;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.ebao.constants.UserType;

/**
 * @desc 对回答投票
 * @author snow
 * @date 2012-7-11
 */
@Entity
@Table(name = "T_Vote_Answer")
public class TVoteAnswer implements Serializable {

	private static final long serialVersionUID = 8566497276335929735L;
	
	private Long id;
	private TAnswer answer;			// 投票的TAnswer
	private UserType userType;		// 用户类型user/doctor
	private String referId;			// 用户Id
	private Integer vote;			// 0赞成/支持,1不同意/反对
	private String voteDate;		// 投票日期

	@Id
	@GeneratedValue
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(optional = false, targetEntity = TAnswer.class)
	@JoinColumn(name = "answer_id")
	public TAnswer getAnswer() {
		return answer;
	}

	public void setAnswer(TAnswer answer) {
		this.answer = answer;
	}

	public UserType getUserType() {
		return userType;
	}

	public void setUserType(UserType userType) {
		this.userType = userType;
	}

	public String getReferId() {
		return referId;
	}

	public void setReferId(String referId) {
		this.referId = referId;
	}

	@Column(length = 1)
	public Integer getVote() {
		return vote;
	}

	public void setVote(Integer vote) {
		this.vote = vote;
	}

	@Column(length = 19)
	public String getVoteDate() {
		return voteDate;
	}

	public void setVoteDate(String voteDate) {
		this.voteDate = voteDate;
	}

}
